﻿using MongoDB.Driver;

namespace Demo.AttachFileService.Mongo.Comon {
    public interface IMongoDatabaseProvider {
        IMongoDatabase Database { get; }
    }

    public class MongoDatabaseProvider : IMongoDatabaseProvider {
        public IMongoDatabase Database { get; private set; }

        public MongoDatabaseProvider(string connectionString, string database) {
            var client = new MongoClient(connectionString);
            Database = client.GetDatabase(database);
        }
    }
}